<!doctype html>
<html class="no-js" lang="">

<head>
  <title></title>
  <meta charset="utf-8">
  <script type="text/javascript" src="/js/dojo/dojo/dojo.js"></script>
</head>

<body>
  <script type="text/javascript">
    // 构造函数会先执行  父类,子类
    dojo.declare("Customer",null,{
      constructor:function(name){
        this.name = name;
        alert("base class");
      },
      say:function(){
        alert(this.name);
      }
    });
    dojo.declare("VIP",Customer,{
      constructor:function(age){
        this.age = age;
        alert("child class");
      },
      say:function(){
        alert("name:" + this.name);
        alert("age:" + this.age);
      }
    });
    var vip = new VIP("123");//1
    vip.say();//2
  </script>
</body>
</html>
